// pages/knowledge/mycourse/mycourse.js
var a, t = getApp(), e = t.requirejs("core"), a = t.requirejs("jquery"), s = t.requirejs("biz/diyform"), i = t.requirejs("biz/goodspicker");

t.requirejs("foxui");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    page: 1,
    loaded: !1,
    loading: !0,
    list: [],
    fromsearch: !1,
    limits: !0,
    modelShow: !1,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var s = this;
    e.fromsearch || this.getList();
  },
  musicurl(e) {
    clearInterval(this.data.durationIntval1);
    wx.setStorageSync('audioSeek', this.data.audioSeek);
    this.setData({
      audioSeek: '',
    })

    var id = wx.getStorageSync('id');
    var type = wx.getStorageSync('type')
    wx.navigateTo({
      url: '/pages/knowledge/videoknow/index?id=' + id + '&type=' + type,
      success: function (res) { },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
  onShow:function(){
    var t = this;
    var isPlayAudio = wx.getStorageSync('isPlayAudio');
    var audioSeek = wx.getStorageSync('audioSeek');
    var id = wx.getStorageSync('id');
    console.log(isPlayAudio, 7878)
    if (isPlayAudio == true) {
      this.data.durationIntval1 = setInterval(function () {
        if (t.data.audioSeek == null || t.data.audioSeek == '') {
          var seek = audioSeek;
        } else {
          var seek = t.data.audioSeek;
        }
        t.setData({
          audioSeek: seek + 1
        })
        wx.setStorageSync('audioSeek', seek + 1);
      }, 1000)
    } else {
      clearInterval(this.data.durationIntval1);
    }
    t.setData({
      isPlayAudio: isPlayAudio
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  getList: function () {
    var t = this;
    t.setData({
      loading: !0
    }), e.get("order/get_listknow",{}, function (e) {
      var a = {
        loading: !1,
        count: e.total,
        show: !0
      };
      t.setData({ list: e.list })
    });
  },

})